import Vue from 'vue';
import Component from 'vue-class-component';
Component.registerHooks([
  'beforeRouteEnter',
  'beforeRouteLeave',
  'beforeRouteUpdate' // for vue-router 2.2+
])
import Router from 'vue-router';

const Home = () => import('@/core/home/home.vue');
const Error = () => import('@/core/error/error.vue');
<%_ if (!skipUserManagement) { _%>
import account from "@/router/account.ts";
<%_ } _%>
import admin from "@/router/admin.ts";
import entities from "@/router/entities.ts";
import pages from "@/router/pages.ts";

Vue.use(Router);

// prettier-ignore
export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home
    },
    {
      path: '/forbidden',
      name: 'Forbidden',
      component: Error,
      meta: { error403: true }
    },
    {
      path: '/not-found',
      name: 'NotFound',
      component: Error,
      meta: { error404: true }
    },
<%_ if (!skipUserManagement) { _%>
    ...account,
<%_ } _%>
    ...admin,
    ...entities,
    ...pages
  ]
});
